#include"translate.cpp"

int main()
{
    FILE* f = NULL;

    setlocale(LC_ALL, "ru");
    if(!(f = fopen("input.txt", "r")))
        {printf("Unable to open input file.");return EXIT_FAILURE;}

    program* pr = syntaxAn(f);
    printLexemes(pr);

    node_t* n = getG(pr);
    printf("\nRoot[%p]\n", n);
    printTree(n);

    fclose(f);

    if (!(f = fopen("outAssembled", "w")))
        {printf("UNABLE TO OPEN ASSEMBLED FILE."); return EXIT_FAILURE;}

    translate(f, n);
    free(pr);
    return 0;
}
